package com.yida;

import org.apache.catalina.connector.Connector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class BlogYidaApplication {

	public static void main(String[] args) {
		SpringApplication.run(BlogYidaApplication.class, args);
	}

	/**  开启兼容http服务
	 
	@Bean
    public ServletWebServerFactory servletContainer() {
        //创建Tomcat服务器工厂实例
        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
        //添加此tomcat实例其它连接参数
        tomcat.addAdditionalTomcatConnectors(httpConnector());
        return tomcat;
    }

	
	public Connector httpConnector() {
			Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
			connector.setScheme("http");
			connector.setPort(8090); // 原http端口
			connector.setSecure(false);
			connector.setRedirectPort(8080); // 跳转的https端口，也就是我们配置文件中配置的项目端口
			return connector;
	}
	
	**/
}
